function V = orto_schmidt(U)

	% Intrari:
	% U- o baza oarecare (data prin n vectori)
	% Iesiri:
	% V - baza ortonormata corespunzatoare

 	[m,n]=size(U);
 	W=zeros(n);
 	for m = 1 : n
      		W(:,m) = U(:,m);
      		for j = 1 : m-1
           		c = U(:,m)'*V(:,j);
              		W(:,m) = W(:,m) - c*V(:,j);
      		endfor
      		V(:,m) = W(:,m) / norm( W(:,m) );
 	endfor

endfunction

